#ifndef __TEEX_DEBUG_H__
#define __TEEX_DEBUG_H__

#include <unistd.h>
#include <stdio.h>

#define NONE                 "\e[0m"
#define BLACK                "\e[0;30m"
#define L_BLACK              "\e[1;30m"
#define RED                  "\e[0;31m"
#define L_RED                "\e[1;31m"
#define GREEN                "\e[0;32m"
#define L_GREEN              "\e[1;32m"
#define BROWN                "\e[0;33m"
#define YELLOW               "\e[1;33m"
#define BLUE                 "\e[0;34m"
#define L_BLUE               "\e[1;34m"
#define PURPLE               "\e[0;35m"
#define L_PURPLE             "\e[1;35m"
#define CYAN                 "\e[0;36m"
#define L_CYAN               "\e[1;36m"
#define GRAY                 "\e[0;37m"
#define WHITE                "\e[1;37m"

#define BOLD                 "\e[1m"
#define UNDERLINE            "\e[4m"
#define BLINK                "\e[5m"
#define REVERSE              "\e[7m"
#define HIDE                 "\e[8m"
#define CLEAR                "\e[2J"
#define CLRLINE              "\r\e[K" //or "\e[1K\r"


#define TEEX_ENABLE_DEBUG   1

#ifdef TEEX_ENABLE_DEBUG
#define TEEX_DEBUG(fmt, ...) do { \
	fprintf(stderr, YELLOW "DEBUG:%s+%d " NONE "==> " fmt, __FILE__, __LINE__, ##__VA_ARGS__); \
} while(0)

#else
#define TEEX_DEBUG(fmt, ...) do { \
} while(1)

#endif /* TEEX_ENABLE_DEBUG */

#define TEEX_ERROR(fmt, ...) do { \
	fprintf(stderr, RED "ERROR:%s+%d " NONE "==> " fmt, __FILE__, __LINE__, ##__VA_ARGS__); \
} while(0)

#endif /* __DEBUG_H__ */

